﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TasksUI
{
    public partial class SearchResults : Form
    {
        public SearchResults()
        {
            InitializeComponent();
        }

        public SearchResults(List<TasksModel.Task> list)
            : this()
        {
            TasksModel.TaskList tl = new TasksModel.TaskList();
            foreach (TasksModel.Task t in list)
                tl.Add(t);
            tlc.TaskList = tl;
        }

        private void SearchResults_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)27)
                bClose_Click(null, null);
        }

        private void bClose_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
